/**
 * @file
 * @author dousha 
 * @date 2021/4/23.
 */

#ifndef PERISCOPE_I2C_BUS_H
#define PERISCOPE_I2C_BUS_H

#include <stdint.h>
#include "stm32f1xx_hal.h"

extern void i2c_write_reg(I2C_HandleTypeDef *, uint8_t, uint8_t, uint8_t);

extern uint8_t i2c_read_reg(I2C_HandleTypeDef *, uint8_t, uint8_t);

extern uint16_t i2c_read_reg_16le(I2C_HandleTypeDef *, uint8_t, uint8_t);

extern uint16_t i2c_read_reg_16be(I2C_HandleTypeDef *, uint8_t, uint8_t);

extern int16_t i2c_read_reg_s16le(I2C_HandleTypeDef *, uint8_t, uint8_t);

extern int16_t i2c_read_reg_s16be(I2C_HandleTypeDef *, uint8_t, uint8_t);

extern void i2c_read(I2C_HandleTypeDef *, uint8_t, uint8_t, uint8_t *, uint32_t);

#endif //PERISCOPE_I2C_BUS_H
